package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysBudgetYouyongMapper;
import com.ruoyi.system.domain.SysBudgetYouyong;
import com.ruoyi.system.service.ISysBudgetYouyongService;

/**
 * SysBudgetYouyongService业务层处理
 * 
 * @author SYF
 * @date 2025-06-10
 */
@Service
public class SysBudgetYouyongServiceImpl implements ISysBudgetYouyongService 
{
    @Autowired
    private SysBudgetYouyongMapper sysBudgetYouyongMapper;

    /**
     * 查询SysBudgetYouyong
     * 
     * @param year SysBudgetYouyong主键
     * @return SysBudgetYouyong
     */
    @Override
    public SysBudgetYouyong selectSysBudgetYouyongByYear(String year)
    {
        return sysBudgetYouyongMapper.selectSysBudgetYouyongByYear(year);
    }

    /**
     * 查询SysBudgetYouyong列表
     * 
     * @param sysBudgetYouyong SysBudgetYouyong
     * @return SysBudgetYouyong
     */
    @Override
    public List<SysBudgetYouyong> selectSysBudgetYouyongList(SysBudgetYouyong sysBudgetYouyong)
    {
        return sysBudgetYouyongMapper.selectSysBudgetYouyongList(sysBudgetYouyong);
    }

    /**
     * 新增SysBudgetYouyong
     * 
     * @param sysBudgetYouyong SysBudgetYouyong
     * @return 结果
     */
    @Override
    public int insertSysBudgetYouyong(SysBudgetYouyong sysBudgetYouyong)
    {
        return sysBudgetYouyongMapper.insertSysBudgetYouyong(sysBudgetYouyong);
    }

    /**
     * 修改SysBudgetYouyong
     * 
     * @param sysBudgetYouyong SysBudgetYouyong
     * @return 结果
     */
    @Override
    public int updateSysBudgetYouyong(SysBudgetYouyong sysBudgetYouyong)
    {
        return sysBudgetYouyongMapper.updateSysBudgetYouyong(sysBudgetYouyong);
    }

    /**
     * 批量删除SysBudgetYouyong
     * 
     * @param years 需要删除的SysBudgetYouyong主键
     * @return 结果
     */
    @Override
    public int deleteSysBudgetYouyongByYears(String[] years)
    {
        return sysBudgetYouyongMapper.deleteSysBudgetYouyongByYears(years);
    }

    /**
     * 删除SysBudgetYouyong信息
     * 
     * @param year SysBudgetYouyong主键
     * @return 结果
     */
    @Override
    public int deleteSysBudgetYouyongByYear(String year) {
        return sysBudgetYouyongMapper.deleteSysBudgetYouyongByYear(year);
    }

    @Override
    @DataSource(DataSourceType.SLAVEDW)
    public List<Map<String,Object>> selectBugetSummary(String year){
        return sysBudgetYouyongMapper.selectBugetSummary(year);
    }
}
